﻿@{
    Layout = null;
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页-@{@WorkContext.MallConfig.SiteTitle}触屏版</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/base.css" rel="stylesheet" type="text/css">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/store.css" rel="stylesheet" type="text/css">
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid=@WorkContext.Uid;
    </script>
</head>

<body>
<div class="viewport">

<header>
  <div class="new-header"> 
    <a href="javascript:pageBack()" class="new-a-back"><span>返回</span></a>
    <h2><div class="storeS"><input type="text" name="storeSearchKeyword" id="storeSearchKeyword" placeholder="搜索本店商品" ><a href="javascript:void(0)" onclick="storeSearch(@WorkContext.StoreId, document.getElementById('storeSearchKeyword').value)" class="icon-search"></a></div></h2>
    <a href="javascript:showClass();" class="store-bt"><span>BRN键</span></a> 
  </div>
</header>

@if (WorkContext.StoreInfo.Banner.Length > 0)
{
<div class="banner"><img id="bannerImg" src="@{@WorkContext.ImageCDN}/upload/store/@WorkContext.StoreId/banner/@WorkContext.StoreInfo.Banner" alt=""></div>
<script type="text/javascript">
    var width = document.body.getElementsByTagName("div")[0].clientWidth;
    document.getElementById("bannerImg").style.width = width + "px";
</script>
}

<div class="storeNav">
@if (WorkContext.StoreInfo.Logo.Length > 0)
{
<div class="logo"><a href="javascript:;"><img src="@{@WorkContext.ImageCDN}/upload/store/@WorkContext.StoreId/logo/@WorkContext.StoreInfo.Logo" alt=""></a><div class="name">@WorkContext.StoreInfo.Name</div></div>
}
<a href="javascript:addStoreToFavorite(@WorkContext.StoreId);" class="storeFav"><i></i><span>关注</span></a>
</div>

@{
    List<CouponTypeInfo> couponTypeList = Coupons.GetSendingCouponTypeList(WorkContext.StoreId, DateTime.Now);
    int couponTypeCount = couponTypeList.Count > 3 ? 3 : couponTypeList.Count;
    }
@if (couponTypeCount > 0)
{
<div class="storeI">
<div class="yhjBox">

@for (int i = 0; i < couponTypeCount; i++)
{
<a href="javascript:getCoupon(@couponTypeList[i].CouponTypeId);" class="yhj">
<p><span class="other">@couponTypeList[i].Money</span><span>@couponTypeList[i].Name</span><span>@couponTypeList[i].SendStartTime.ToShortDateString() - @couponTypeList[i].SendEndTime.ToShortDateString()</span></p>
<img src="@{@WorkContext.ImageCDN}/mobile/images/yhj.png" width="242" height="106"> 
</a>
}

<a href="@Url.Action("coupontypelist", new RouteValueDictionary { { "storeId", WorkContext.StoreId } })" class="more">更多&gt;</a>
</div>
</div>
}

<div class="storeI">
<h2>店铺精品</h2>
<ul class="storeList">

@foreach (PartProductInfo info in Products.GetStoreTraitProductList(8, WorkContext.StoreInfo.StoreId, 0, 0))
{
<li>
    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })">
        <div class="img"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg"></div>
        <div class="p-info">@info.Name</div>
        <div class="price">￥@info.ShopPrice</div>
    </a>
</li>
}

</ul>
</div>

<div class="storeI">
<h2>店铺热销</h2>
<ul class="storeList">

@foreach (PartProductInfo info in Products.GetStoreTraitProductList(8, WorkContext.StoreInfo.StoreId, 0, 1))
{
<li>
    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })">
        <div class="img"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg"></div>
        <div class="p-info">@info.Name</div>
        <div class="price">￥@info.ShopPrice</div>
    </a>
</li>
}

</ul>
</div>

<div class="storeI">
<h2>店铺新品</h2>
<ul class="storeList">

@foreach (PartProductInfo info in Products.GetStoreTraitProductList(8, WorkContext.StoreInfo.StoreId, 0, 2))
{
<li>
    <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", info.Pid } })">
        <div class="img"><img src="@{@WorkContext.ImageCDN}/upload/store/@info.StoreId/product/show/thumb230_230/@info.ShowImg"></div>
        <div class="p-info">@info.Name</div>
        <div class="price">￥@info.ShopPrice</div>
    </a>
</li>
}

</ul>
</div>

</div>




@{
    List<StoreClassInfo> storeClassList = Stores.GetStoreClassList(WorkContext.StoreId);
    }
<div id="bg" onclick="hideClass()" class="bg" style="display:none; position:fixed;left:0px;top:0px;background-color:rgb(13, 13, 13);filter:alpha(opacity=60);opacity: 0.6;width:100%;height:100%;z-index:8888;"></div>
<div id="classSelect" class="selectR" style=" display:none;">
<div class="info">
<div class="name">@WorkContext.StoreInfo.Name</div>
<div class="score">
<i></i>
<i></i>
<i></i>
<i></i>
<i class="icon-empty"></i>
<span>9.82 分</span>
</div>
@*
<div class="score-list">
  <ul>
    <li>
      <div class="key">商品评分</div>
      <div class="value"><i class="  icon-up "></i><span>9.84 分</span></div>
    </li>
    <li>
      <div class="key">服务评分</div>
      <div class="value"><i class=" icon-up down "></i><span>9.70 分</span></div>
    </li>
    <li>
      <div class="key">时效评分</div>
      <div class="value">
      <i class=" icon-up "></i><span>9.93 分</span></div>
    </li>
    <div class="clear"></div>
  </ul>
  <div class="divider"></div>
  <div class="divider"></div>
</div>
*@
</div>
<ul>

<li>
    @foreach (StoreClassInfo info in storeClassList)
    {
    <a href="@Url.Action("class", new RouteValueDictionary { { "storeId", WorkContext.StoreId }, { "storeCid", info.StoreCid } })" class="dt on">@info.Name</a>
    }
    @*
<div class="selectCon" style="display:block;">
<ul>
  <li><a href="javascript:void(0)" class="on"><span>全部</span></a></li>
  <li><a href="javascript:void(0)"><span>丹杰仕（DANJIESHI）</span></a></li>
  <li><a href="javascript:void(0)"><span>北极绒（BEJIROG）</span></a></li>
  <li><a href="javascript:void(0)"><span>有衣有靠（UYUK）</span></a></li>
  <li><a href="javascript:void(0)"><span>恒源祥（HYX）</span></a></li>
  <li><a href="javascript:void(0)" class="on"><span>全部</span></a></li>
  <li><a href="javascript:void(0)"><span>丹杰仕（DANJIESHI）</span></a></li>
  <li><a href="javascript:void(0)"><span>北极绒（BEJIROG）</span></a></li>
  <li><a href="javascript:void(0)"><span>有衣有靠（UYUK）</span></a></li>
  <li><a href="javascript:void(0)"><span>恒源祥（HYX）</span></a></li>
  <li><a href="javascript:void(0)" class="on"><span>全部</span></a></li>
  <li><a href="javascript:void(0)"><span>丹杰仕（DANJIESHI）</span></a></li>
  <li><a href="javascript:void(0)"><span>北极绒（BEJIROG）</span></a></li>
  <li><a href="javascript:void(0)"><span>有衣有靠（UYUK）</span></a></li>
  <li><a href="javascript:void(0)"><span>恒源祥（HYX）</span></a></li>
</ul>

</div>
*@
</li>

</ul>
</div>
<script type="text/javascript">
    //高度需要计算 .bg的高度 = 当前body的高度
    document.getElementById("bg").style.height = document.body.scrollHeight + "px";

    //当selectR展开时， 需要隐藏body的滚动条。 方法是给body添加css：   overflwo:hidden;
    function showClass() {
        document.getElementById("bg").style.display = "";
        document.getElementById("classSelect").style.display = "";
        document.body.style.overflow = "hidden";
    }

    function hideClass() {
        document.getElementById("bg").style.display = "none";
        document.getElementById("classSelect").style.display = "none";
        document.body.style.overflow = "visible";
    }

</script>

</body>
</html>
